package fun.boomcat.luckyhe.mirai.plugin.luckymoney.service;

import fun.boomcat.luckyhe.mirai.plugin.luckymoney.entity.UserMoney;
import fun.boomcat.luckyhe.mirai.plugin.luckymoney.exception.MoneyNotEnoughException;
import org.apache.ibatis.annotations.Param;

import java.io.IOException;

/**
 * @author Lucky_He
 * @date 2021年9月5日 14:58
 * @description MoneyService
 */
public interface MoneyService {
    int createMoneyDB() throws IOException;
    int createMoneyTable() throws IOException;
    UserMoney selectUserMoneyByQq(long qq) throws IOException;
    int insertUserMoney(UserMoney userMoney) throws IOException;
    int addUserMoney(UserMoney userMoney, int addMoney) throws IOException;
    int addUserMoneyByQq(long qq, int addMoney) throws IOException;
    int takeUserMoney(UserMoney userMoney, int delMoney) throws IOException, MoneyNotEnoughException;
    int takeUserMoneyByQq(long qq, int delMoney) throws IOException, MoneyNotEnoughException;
    int forceTakeUserMoney(UserMoney userMoney, int delMoney) throws IOException;
    int forceTakeUserMoneyByQq(long qq, int delMoney) throws IOException;
    UserMoney getUserMoneyByQq(long qq) throws IOException;
    void payUserMoney(UserMoney srcUser, UserMoney destUser, int money) throws IOException, MoneyNotEnoughException;
    void payUserMoneyByQq(long srcQq, long destQq, int money) throws IOException, MoneyNotEnoughException;
}
